package edu.uniquindio.prmaven.proyectofinal;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.testng.annotations.Test;

import edu.uniquindio.prmaven.general.TestCore;

public class KeyBoard_2 extends TestCore {
	
	@Test()
	/**
	dataProviderClass = edu.uniquindio.prmaven.dataprovider.DataProviderFactory.class, 
	dataProvider = ConfigurationConstants.DP_FACTORY
	@DataProviderArguments(ConfigurationConstants.ESCENARIO
			+ ConfigurationConstants.EQUALS + DataProvidersConstants.HOJA_1)
			**/
	
	public void testKeyBoard_2() throws Exception {
		
		try {
			
		selenium.open("/showcase/");
		
		//selenium.click("id=SubMenu-Input"); Seleccionar menu Input
		WebElement menuInput=driver.findElement(By.id("SubMenu-Input"));
		menuInput.click();
		
		//selenium.click("link=• Keyboard");xpath .//*[@id='MENUSIDEindent']/div[3]/a[22]
		WebElement submenuKeyBoard=driver.findElement(By.xpath("//*[@id='MENUSIDEindent']/div[3]/a[22]"));
		submenuKeyBoard.click();
		
		selenium.waitForPageToLoad("30000");
		
		//selenium.click("id=j_idt86:qwerty"); xpath .//*[@id='j_idt86:qwerty']
		WebElement campoQuerty=driver.findElement(By.id("j_idt86:qwerty"));
		campoQuerty.click();
		
		//selenium.click("xpath=(//button[@type='button'])[18]"); seleccion letra "h"
		WebElement letra1=driver.findElement(By.xpath("(//button[@type='button'])[18]"));
		letra1.click();
		
		//selenium.click("xpath=(//button[@type='button'])[10]"); Seleccion Letra "o"
		WebElement letra2=driver.findElement(By.xpath("(//button[@type='button'])[10]"));
		letra2.click();
		
		//selenium.click("xpath=(//button[@type='button'])[21]"); Seleccion Letra "l"
		WebElement letra3=driver.findElement(By.xpath("(//button[@type='button'])[21]"));
		letra3.click();
		
		//selenium.click("xpath=(//button[@type='button'])[30]");Seleccion opcion "Shif"
		WebElement shif=driver.findElement(By.xpath("(//button[@type='button'])[30]"));
		shif.click();
		
		//selenium.click("xpath=(//button[@type='button'])[13]"); Seleccion letra "A"
		WebElement letra4=driver.findElement(By.xpath("(//button[@type='button'])[13]"));
		letra4.click();
		
		//selenium.click("xpath=(//button[@type='button'])[12]"); Seleccion opcion "Close"
		WebElement close=driver.findElement(By.xpath("(//button[@type='button'])[12]"));
		close.click();
		
		//selenium.click("id=j_idt86:j_idt98"); xpath .//*[@id='j_idt86:j_idt98'] boton submit
		WebElement botonSubmit=driver.findElement(By.xpath("//*[@id='j_idt86:j_idt98']"));
		botonSubmit.click();
		
		Assert.assertEquals(selenium.getText("//table[@id='j_idt86:display']/tbody/tr[2]/td[2]"), "holA");

		
	}catch(AssertionError e){
		System.out.println("no se encontro texto");
	}finally{
		
	}
}

}


